#include "stdafx.h"

#include "PFControllorPool.h"

#include "PFControllorList.h"

PFControllorPool * PFControllorPool::GetInstance()
{
	static PFControllorPool pool;
	return &pool;
}

PFControllor * PFControllorPool::GetControllor(PFControllorType type) const
{
	const std::unordered_map<PFControllorType, PFControllor *> & controllors = PFControllorList::GetList();
	auto iter = controllors.find(type);
	if (iter != controllors.end())
	{
		return iter->second;
	}

	PFControllorList loader;
	return loader.GetControllor(type);
}

PFControllorPool::~PFControllorPool()
{
	PFControllorList::CleanList();
}


